package day10;

import java.util.ArrayList;
import java.util.Arrays;

public class Demo04 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6,5,8,1,2,9,2};
        System.out.println(arr);//打印的时地址值（哈希值）
        System.out.println(Arrays.toString(arr));//重写  遍历 [1, 2, 3, 4, 5, 6, 5, 8, 1, 2, 9, 2]
        Arrays.sort(arr);//排序
        System.out.println(Arrays.toString(arr));//[1, 1, 2, 2, 2, 3, 4, 5, 5, 6, 8, 9]
        System.out.println(Arrays.binarySearch(arr,3));//查找数组中的值输出下标  5
        arr = Arrays.copyOf(arr,15);//数组扩容
        System.out.println(arr.length);//15  长度
    }
}
